<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改游戏段位')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-grade-edit" th:object="${dlGameGrade}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">游戏选择：</label>
            <div class="col-sm-8">
                <select name="gameId" class="form-control m-b" th:with="dlRecreationList=${dlRecreationList}" required>
                    <option value="">请选择</option>
                    <option th:each="dlRecreationList : ${dlRecreationList}" th:text="${dlRecreationList.gameName}"
                            th:value="${dlRecreationList.id}"
                            th:selected="${dlRecreationList.id} eq ${dlGameGrade.gameId} "></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">代练类型：</label>
            <div class="col-sm-8">
                <select name="trainType" class="form-control m-b" th:with="type=${@dict.getType('dl_train_type')}" required>
                    <option value="">请选择</option>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:selected="${dict.dictValue} eq ${dlGameGrade.trainType} "></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">段位分段描述：</label>
            <div class="col-sm-8">
                <input name="title" th:field="*{title}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">金额：</label>
            <div class="col-sm-8">
                <input name="moneyVal" th:field="*{moneyVal}" class="form-control" type="number" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "dl/grade";
    $("#form-grade-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-grade-edit').serialize());
        }
    }
</script>
</body>
</html>
